package xiaohu.day2.HJ22;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int N = in.nextInt();
            if (N >= 1 && N <= 100) {
                int num = hasNumber(N);
                System.out.println(num);
            }
        }
    }

    private static int hasNumber(int N) {
        int count=0;
        while (N > 2) {
            count=count+N/3;
            N=N/3+N%3;
        }
        if (N == 2) {
            count++;
        }
        return count;
    }
}
